package com.xfcy.base.exeption;

import lombok.Data;

/**
 * @author 晓风残月Lx
 * @date 2023/6/15 16:48
 * 项目异常类
 */
@Data
public class XfcyException extends RuntimeException {

    private String errMessage;

    public XfcyException() {

    }

    public XfcyException(String message) {
        super(message);
        this.errMessage = message;
    }


    public static void cast(String message) {
        throw new XfcyException(message);
    }

    public static void cast(CommonError commonError) {
        throw new XfcyException(commonError.getErrMessage());
    }


}
